package com.s59.controller;

import com.s59.Service.BookService;
import com.s59.Service.BootOrderService;
import com.s59.dao.BookDao;
import com.s59.dao.BootOrderDao;
import com.s59.entity.BootOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.UUID;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private BootOrderService bootOrderService;

    @PostMapping
    public boolean create(@RequestBody BootOrder bootOrder){
        bootOrderService.seafcreateOrder(bootOrder);
        return true;
    }

    @GetMapping("/sk")
    public String ms(Long bookId,Integer userId){
        boolean seecess = bootOrderService.ms(bookId,userId);
        return seecess ?"秒杀成功":"秒杀失败";
    }
}
